package com.dg.common;

import lombok.*;

import javax.validation.constraints.Min;

@Setter
@Getter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PageQuery {

    @Min(value = 1, message = "当前页码不合法")
    private int pageNum = 1;


    @Min(value = 1, message = "每页展示数量不合法")
    private int pageSize = 10;


    private int offset;

    public int getOffset() {
        return (pageNum - 1) * pageSize;
    }

}
